package com.ruoyi.seedlingSys.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.seedlingSys.mapper.TemperaturerecordMapper;
import com.ruoyi.seedlingSys.domain.Temperaturerecord;
import com.ruoyi.seedlingSys.service.ITemperaturerecordService;

/**
 * 记录温度和湿度数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-11
 */
@Service
public class TemperaturerecordServiceImpl implements ITemperaturerecordService 
{
    @Autowired
    private TemperaturerecordMapper temperaturerecordMapper;

    /**
     * 查询记录温度和湿度数据
     * 
     * @param recordID 记录温度和湿度数据主键
     * @return 记录温度和湿度数据
     */
    @Override
    public Temperaturerecord selectTemperaturerecordByRecordID(Long recordID)
    {
        return temperaturerecordMapper.selectTemperaturerecordByRecordID(recordID);
    }

    /**
     * 查询记录温度和湿度数据列表
     * 
     * @param temperaturerecord 记录温度和湿度数据
     * @return 记录温度和湿度数据
     */
    @Override
    public List<Temperaturerecord> selectTemperaturerecordList(Temperaturerecord temperaturerecord)
    {
        return temperaturerecordMapper.selectTemperaturerecordList(temperaturerecord);
    }

    /**
     * 新增记录温度和湿度数据
     * 
     * @param temperaturerecord 记录温度和湿度数据
     * @return 结果
     */
    @Override
    public int insertTemperaturerecord(Temperaturerecord temperaturerecord)
    {
        temperaturerecord.setCreateTime(DateUtils.getNowDate());
        return temperaturerecordMapper.insertTemperaturerecord(temperaturerecord);
    }

    /**
     * 修改记录温度和湿度数据
     * 
     * @param temperaturerecord 记录温度和湿度数据
     * @return 结果
     */
    @Override
    public int updateTemperaturerecord(Temperaturerecord temperaturerecord)
    {
        temperaturerecord.setUpdateTime(DateUtils.getNowDate());
        return temperaturerecordMapper.updateTemperaturerecord(temperaturerecord);
    }

    /**
     * 批量删除记录温度和湿度数据
     * 
     * @param recordIDs 需要删除的记录温度和湿度数据主键
     * @return 结果
     */
    @Override
    public int deleteTemperaturerecordByRecordIDs(Long[] recordIDs)
    {
        return temperaturerecordMapper.deleteTemperaturerecordByRecordIDs(recordIDs);
    }

    /**
     * 删除记录温度和湿度数据信息
     * 
     * @param recordID 记录温度和湿度数据主键
     * @return 结果
     */
    @Override
    public int deleteTemperaturerecordByRecordID(Long recordID)
    {
        return temperaturerecordMapper.deleteTemperaturerecordByRecordID(recordID);
    }
}
